from datetime import timedelta

from celery import Celery

backend = 'redis://127.0.0.1:6379/1'  # 执行结果保存的redis地址
broker = 'redis://127.0.0.1:6379/0'  # 执行任务的提交地址
app = Celery(__name__, backend=backend, broker=broker, include=['celery_task.user_task', ])  # include中放任务的地址

# 定时任务
# app.conf.beat_schedule = {
#     'update_banner': {
#         'task': 'celery_task.user_task.update_status',
#         'schedule': timedelta(seconds=50),
#         'args': (user_id),
#     }
# }
